// src/api/attendance.js
import request from '../utils/request';

// 获取部门列表
export const getDepartments = () => {
  return request.get('/department');
};

// 获取职位列表
export const getPositions = () => {
  return request.get('/position');
};

// 获取所有考勤数据
export const getAttendanceData = (page, pageSize) => {
  return request.get('/check/all');
};

//修改编辑的状态
export const updateAttendanceStatus = (id, status) => {
  return request.put('/check/edit', {id, status });
};

// 一键打卡
export const clockIn = (ids) => {
  return request.put('/check/lot', ids); // 确保后端接口可以处理 ids 数组
};

//添加考勤表
export const addAttendance = (attendanceRecords) => {
  return request.post('/check/add', attendanceRecords);
};